<%--
  Created by IntelliJ IDEA.
  User: kangx
  Date: 2020/8/16
  Time: 16:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>欢迎页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <!--        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />-->
    <!--<link rel="stylesheet" href="./css/font.css">-->
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <script>
        var path='${AppPath}';
    </script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/index.js"></script>
    <script src="./js/jquery.js"></script>
    <script src="./js/jquery.min.js"></script>
    <script src="./js/survey.js"></script>
    <style>
        #FontScroll{
            width: 100%;
            height: 245px;
            overflow: hidden;
        }
        #FontScroll ul li{
            height: 32px;
            width: 100%;
            color: #ffffff;
            line-height: 32px;
            overflow: hidden;
            font-size: 14px;
        }
        #FontScroll ul li i{
            color: red;
        }
        .layui-table td, .layui-table th{
            min-width: auto !important;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">

            </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">数据统计</div>
                <div class="layui-card-body ">
                    <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>教师数量</h3>
                                <p>
                                    <cite id="teacherCount"></cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>学生数量</h3>
                                <p>
                                    <cite id="studentCount"></cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>合作单位</h3>
                                <p>
                                    <cite id="companyCount"></cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>公告</h3>
                                <p>
                                    <cite>125</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>邮件</h3>
                                <p>
                                    <cite>110</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6 ">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>友情链接</h3>
                                <p>
                                    <cite>163</cite></p>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">课表

                </div>
                <div class="layui-card-body  ">
                    <table class="layui-table layui-form" id="table_id" lay-filter="dataTable"></table>
                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md3">
            <div class="layui-card" style="height: 323px">
                <div class="layui-card-header">各学院人数比例

                </div>
                <div class="layui-card-body ">
                    <div id="chart2" style="width: 100%;height: 245px;"></div>

                </div>
            </div>
        </div>
        <div class="layui-col-sm6 layui-col-md3">
            <div class="layui-card" style="height: 323px">
                <div class="layui-card-header">数据月统计

                </div>
                <div class="layui-card-body ">

                    <div id="chart4" style="width: 100%;height: 245px;"></div>
                </div>
            </div>
        </div>

        <div class="layui-col-sm6 layui-col-md2">
            <div class="layui-card" style="height: 323px">
                <div class="layui-card-header">最新消息

                </div>
                <div class="layui-card-body ">

                    <div class="news_style">

                        <div class="myscroll" id="FontScroll">
                            <ul class="list" id="gun_id">
                                <li><i class="iconfont">&#xe622;</i><a href="#">1.景区发一米帽提醒保持距离</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">2.美国首次发现“杀手大黄蜂”...</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">3.相信未来义演开唱</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">4.张文宏评价这届年轻人更加无畏</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">5.王菲常石磊合唱人间</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">6.央视五四特别节目</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">7.特朗普点名吐槽弗吉尼亚州</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">8.这届青年人的新偶像</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">9.错换人生河南生父挂锁为儿祈福</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">10.陈伟霆把猫唱睡着了</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">11.武功山观光直升机低空侧翻</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">12.新闻联播揭蓬佩奥大肆喷毒造谣</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">13.巴西总统带头抗议居家令</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">14.著名化学家张乾二院士逝世</a></li>
                                <li><i class="iconfont">&#xe622;</i><a href="#">15.美国新冠肺炎确诊人数超115万</a></li>

                            </ul>
                        </div>

                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">系统信息</div>
                <div class="layui-card-body ">

                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th colspan="4" scope="col">服务器信息</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <th>服务器计算机名</th>
                            <td><span id="lbServerName">http://127.0.0.1/</span></td>

                        </tr>
                        <tr>
                            <td>服务器IP地址</td>
                            <td>192.168.1.1</td>
                        </tr>
                        <tr>
                            <td>服务器域名</td>
                            <td>www.xxx.net</td>

                        </tr>
                        <tr>
                            <td>服务器端口 </td>
                            <td>80</td>
                        </tr>
                        <tr>
                            <td>服务器IIS版本 </td>
                            <td>Microsoft-IIS/6.0</td>

                        </tr>
                        <tr>
                            <td>本文件所在文件夹 </td>
                            <td>D:\WebSite\</td>
                        </tr>
                        <tr>
                            <td>服务器操作系统 </td>
                            <td>Microsoft Windows NT 5.2.3790 Service Pack 2</td>

                        </tr>
                        <tr>
                            <td>系统所在文件夹 </td>
                            <td>C:\WINDOWS\system32</td>
                        </tr>
                        <tr>
                            <td>服务器脚本超时时间 </td>
                            <td>30000秒</td>

                        </tr>
                        <tr>
                            <td>服务器的语言种类 </td>
                            <td>Chinese (People's Republic of China)</td>
                        </tr>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>


        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <p style="text-align: center;"> Copyright ©2020  All Rights Reserved.</p>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
<script src="./js/echarts.min.js"></script>
<script type="text/javascript">


    /**
     * 新闻滚动条
     * */
    $(function () {
        $('.myscroll').myScroll({
            speed: 60, //数值越大，速度越慢
            rowHeight: 38 //li的高度
        });

    });

    /**
     * 滚动条添加数据
     * */
    // $.get({
    //     url:"http://api.avatardata.cn/HistoryToday/LookUp?key=bca696426acd48efa3b09a51dfdd2227&yue=1&ri=1&type=1&page=1&rows=5",
    //     dataType:"json",
    //     success:function(obj){
    //         console.log(obj)//成功拿到数据.
    //         alert(obj)
    //     }
    //
    // })

    /**
     * 加载统计信息
     * */
    $.ajax({
        url:path+'/welcome/count',
        type:"post",
        success:function (data) {
            // alert(JSON.stringify(data))
            $("#studentCount").text(data.studentCount);
            $("#teacherCount").text(data.teacherCount);
            $("#companyCount").text(data.companyCount);

        }
    })

    layui.use(['layer','table','form'], function(){
        var layer = layui.layer;
        var table= layui.table;
        var form = layui.form;
        var remember = '';

        //生成表格
        var count=0;
        table.render({
            id:"dataTable",//
            elem: '#table_id',//指定表格元素
            url: 'coursetable/showCourseTable',  //请求路径
            cellMinWidth: 10//全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,skin: 'line ' //表格风格 line （行边框风格）row （列边框风格）nob （无边框风格）
            ,even: true    //隔行换色
            ,method:'post'  //提交方式
            ,cols:[
                [{
                    field: 'time', //json对应的key
                    title: '时间',   //列名
                    sort: false,   // 默认为 false,true为开启排序
                    templet: function (d) {
                        count++;
                        if (count==5){
                            return "晚自习";
                        }
                        return '第'+count+'节';
                    }
                },
                    {
                        field: 'monday', //json对应的key
                        title: '星期一',   //列名
                        sort: false   // 默认为 false,true为开启排序
                    },
                    {
                        field: 'tuesday', //json对应的key
                        title: '星期二',   //列名
                        sort: false   // 默认为 false,true为开启排序
                    },
                    {
                        field: 'wednesday', //json对应的key
                        title: '星期三',   //列名
                        sort: false   // 默认为 false,true为开启排序
                    },
                    {
                        field: 'thursday', //json对应的key
                        title: '星期四',   //列名
                        sort: false   // 默认为 false,true为开启排序
                    },
                    {
                        field: 'friday', //json对应的key
                        title: '星期五',   //列名
                        sort: false   // 默认为 false,true为开启排序
                    }]
            ]
            ,done: function(res, curr, count) { //表格数据加载完后的事件
                //如果是异步请求数据方式，res即为你接口返回的信息。
                //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
                console.log(res);

                //得到当前页码
                console.log(curr);

                //得到数据总量
                console.log(count);
            }

        })

        /**
         * 便签
         */
        $(document).ready(function(){
            layer.prompt({
                formType: 2,
                anim: 3,
                offset: 'rb',
                value: "",
                title: '便签',
                skin: 'demo-class',
                area: ['280px', '150px'],
                id: 'remember' ,//设定一个id，防止重复弹出
                btn: ['确定', '取消'],
                shade: 0,
                moveType: 1, //拖拽模式，0或者1
                btn2: function(index, layero){
                    $.ajax({
                        url:"delremember.html"
                        ,type:"post"
                        ,success:function(res) {
                            layer.msg(res.msg);
                            if(res.code == 1) {
                                $('#remember textarea').val('');
                            }
                        }
                    })
                    return false;
                }
            },function(value, index, elem){
                $.ajax({
                    url:"/admin/main/remember.shtml"
                    ,type:"post"
                    ,data:{message:value}
                    ,success:function(res) {
                        layer.msg(res.msg);
                    }
                })
            })
        });
    });


    function getTime(){
        var myDate = new Date();
        var myYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
        var myMonth = myDate.getMonth()+1; //获取当前月份(0-11,0代表1月)
        var myToday = myDate.getDate(); //获取当前日(1-31)
        var myDay = myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
        var myHour = myDate.getHours(); //获取当前小时数(0-23)
        var myMinute = myDate.getMinutes(); //获取当前分钟数(0-59)
        var mySecond = myDate.getSeconds(); //获取当前秒数(0-59)
        var week = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
        var nowTime;

        nowTime = myYear+'-'+fillZero(myMonth)+'-'+fillZero(myToday)+'&nbsp;&nbsp;'+fillZero(myHour)+':'+fillZero(myMinute)+':'+fillZero(mySecond)+'&nbsp;&nbsp;'+week[myDay]+'&nbsp;&nbsp;';
        //console.log(nowTime);
        $('#time').html(nowTime);
    };

    function fillZero(str){
        var realNum;
        if(str<10){
            realNum	= '0'+str;
        }else{
            realNum	= str;
        }
        return realNum;
    }
    setInterval(getTime,1000);
</script>
<script src="js/fontscroll.js"></script>

</html>